<!DOCTYPE html>
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <meta name="description" content="">
    <meta name="author" content="">
    <title>SB Admin</title>
    <!-- Bootstrap core CSS-->
    <link href="css/bootstrap.min.css" rel="stylesheet">
    <!-- Custom fonts for this template-->
    <link href="css/font-awesome.min.css" rel="stylesheet" type="text/css">
    <!-- Custom styles for this template-->
    <link href="css/sb-admin.css" rel="stylesheet">
    <script>
        function validate() {
            var lPass = $("#lPass").val();
            var lPass1 = $("#lPass1").val();
            <!-- 对比两次输入的密码 -->
            if (lPass == lPass1) {
                $("#tishi").html("两次密码相同")
                $("#tishi").css("color", "green");
                $("#xiugai").removeAttr("disabled")
            } else {
                $("#tishi").html("两次密码不相同");
                $("#tishi").css("color", "red")
                $("button").attr("disabled", "disabled")
            }
        }
    </script>
</head>

<body class="bg-dark">
<div class="container">
    <div class="card card-login mx-auto mt-5">
        <div class="card-header">注册一个账户</div>
        <div class="card-body">
            <form action="addlogin.action" method="post">
                <div class="form-group">
                    <label for="lName">用户名</label>
                    <input class="form-control" id="lName" name="lName" type="text" placeholder="请输入用户名">
                </div>
                <div class="form-group">
                    <label for="lPass">密码</label>
                    <input class="form-control" id="lPass" name="lPass" type="password" placeholder="请输入密码">
                </div>
                <div class="form-group">
                    <label for="lPass1">确认密码</label>
                    <input class="form-control" id="lPass1" name="lPass1" type="password" placeholder="确认密码"
                           onkeyup="validate()">
                    <span id="tishi"></span>
                </div>
                <div class="form-group">
                    <label for="rId">角色</label>
                    <select id="rId" name="rId">
                        <c:forEach items="${roles}" var="role">
                            <option value="${role.rId}">${role.rName}</option>
                        </c:forEach>
                    </select>
                </div>
                <input class="btn btn-primary btn-block" type="submit" value="注册">
            </form>
            <div class="text-center">
                <a class="d-block small mt-3" href="tologin1.action">返回登录页面</a>
            </div>
        </div>
    </div>
</div>
<!-- Bootstrap core JavaScript-->
<script src="js/jquery.min.js"></script>
<script src="js/bootstrap.bundle.min.js"></script>
<!-- Core plugin JavaScript-->
<script src="js/jquery.easing.min.js"></script>
</body>

</html>
